<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <div id="app">
      <input type="text" ref="inputEL" value="jack" />
    </div>
    <script type="module">
      import {
        createApp,
        ref,
        onMounted,
        watchEffect,
        watchPostEffect,
      } from "./vue.esm-browser.js";
      const app = createApp({
        setup() {
          const inputEL = ref(null);

          watchPostEffect(() => {
            // if (inputEL.value !== null) {
            console.log(inputEL.value.value);
            // }
          });
          setTimeout(() => {
            inputEL.value = { value: 100 };
          }, 3000);
          // onMounted(() => {
          //   console.log(inputEL.value.value);
          // });
          return {
            inputEL,
          };
        },
      });

      app.mount("#app"); //挂载
    </script>
  </body>
</html>
